home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209b.zip / octave-2.09 / DLFCN.ZIP / dlfcn / octave / pt-mat.h < prev    next >
C/C++ Source or Header  |  1997-08-20  |  2KB  |  94 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_tree_mat_h)
  24. #define octave_tree_mat_h 1
  25.  
  26. #if defined (__GNUG__)
  27. #pragma interface
  28. #endif
  29.  
  30. class ostream;
  31.  
  32. class octave_value;
  33. class tree_return_list;
  34.  
  35. class tree_walker;
  36.  
  37. #include <SLList.h>
  38.  
  39. #include "pt-exp.h"
  40.  
  41. // General matrices.  This allows us to construct matrices from
  42. // other matrices, variables, and functions.
  43.  
  44. class
  45. tree_matrix_row : public SLList<tree_expression *>
  46. {
  47. public:
  48.  
  49.   tree_matrix_row (tree_expression *e = 0) : SLList<tree_expression *> ()
  50.     {
  51.       if (e)
  52.     append (e);
  53.     }
  54.  
  55.   ~tree_matrix_row (void) { }
  56.  
  57.   bool all_elements_are_constant (void) const;
  58.  
  59.   tree_return_list *to_return_list (void);
  60.  
  61.   void accept (tree_walker& tw);
  62. };
  63.  
  64. class
  65. tree_matrix : public tree_expression, public SLList<tree_matrix_row *>
  66. {
  67. public:
  68.  
  69.   tree_matrix (tree_matrix_row *mr = 0)
  70.     : tree_expression (), SLList<tree_matrix_row *> ()
  71.       {
  72.     if (mr)
  73.       append (mr);
  74.       }
  75.  
  76.   ~tree_matrix (void) { }
  77.  
  78.   bool all_elements_are_constant (void) const;
  79.  
  80.   octave_value eval (bool print);
  81.  
  82.   void accept (tree_walker& tw);
  83. };
  84.  
  85. extern void symbols_of_pt_mat (void);
  86.  
  87. #endif
  88.  
  89. /*
  90. ;;; Local Variables: ***
  91. ;;; mode: C++ ***
  92. ;;; End: ***
  93. */
  94.